<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 接受二维数组
        const result = Object.fromEntries([
            ['name','小明'],
            ['school','清华,北大,哈佛']
        ]);
        console.log(result);//{name: '小明', school: '清华,北大,哈佛'}

        // 接收Map
        const m = new Map();
        m.set('name','小红');
        const result2 = Object.fromEntries(m);
        console.log(result2);//{name: '小红'}

        // Object.fromEntries相当于ES8中的Object.entries方法的逆运算
        // 接收一个对象，将对象转化为二维数组
        const arr = Object.entries({
            name:'小兰'
        })
        console.log(arr);
    </script>
</body>
</html>